var utils = require("../../utils/util.js");
var app = getApp();
Page({
  data: {
    dominameImg: utils.dominameImg
  },
  onLoad:function(){
    var that = this;
    wx.showLoading({
      title: '加载中',
    });
    wx.request({
      url: utils.dominame + '/api/v1/myself/myselfInfo',
      data: {
        token: app.globalData.token,
      },
      method: "GET",
      header: {
        "Content-Type": "application/x-www-form-urlencoded"  //post
      },
      complete: function (res) {
        wx.hideLoading();
      },
      success: function (res) {
        console.log(res);
        if (res.data.code == 0) {
          that.setData({
            headPortrait: res.data.data.head_portrait,
            nickname: res.data.data.nickname,
            send: res.data.data.send,
            payment: res.data.data.payment,
            receipt: res.data.data.receipt,
          });
        }
      }
    })
  },
  gomyOrder:function(e){
    wx.navigateTo({
      url: 'myOrder/myOrder?type='+e.currentTarget.id,
    })
  },
  OrderTheOrder:function(){
    wx.navigateTo({
      url: 'myReservationOrder/myReservationOrder',
    })   
  },
  toMyAcount:function(){
    wx.navigateTo({
      url: 'myAccount/myAccount',
    }) 
  },
  toMyFollow:function(){
    wx.navigateTo({
      url: 'myFollow/myFollow',
    })
  },
  toAddresList:function(){
    wx.navigateTo({
      url: 'addressList/addressList?canTap=false',
    })
  },
  onPullDownRefresh: function () {
    console.log('下拉');
    this.onLoad();
    wx.stopPullDownRefresh();
  },
})